App Store submission steps
From Christian Schmitz. Based on a text from Thomas Tempelmann.
To get an application in the App Store, follow this steps:
Prerequisites
- Sign up for the Mac Developer Program ($99/year), see http://developer.apple.com/programs/mac/
- Read Apples documentation
- Get familiar with the checklist at https://developer.apple.com/devcenter/mac/checklist/
- The app must be built for Intel. If it's PPC only, it won't work. Universal apps can be submitted, but are a waste of space.
- Any resources (extra files) the app requires must be inside its .app bundle (preferably inside Contents/Resources).
- The app may not modify any of its bundle contents. If it does, the app must be rewritten to follow the rules explained here: https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html
- You need a 512x512 (pixels) app icon.
- You need to have created, downloaded and installed into your Default Keychain the two personal app certificates, available here: http://developer.apple.com/certificates/. Also download and install the "WWDR intermediate certificate" that's available on the same page so that your certificates do not show a red warning that they're "signed by an unknown authority".
- Your app needs to have a proper bundle identifier (using reverse DNS naming, using a domain that you own, to make sure your identifier is unique), and you need to register it under "Mac App IDs" in http://developer.apple.com/certificates/.
- An account must be opened at https://itunesconnect.apple.com/ and the to-be-submitted app must have been created under "Manage Your Applications".
Preparing your application for submission
- Decide if you want to enforce that the application can only be used if the user has actually "purchased" it from the App Store, preventing users from copying the app to unlimited other computers. If you want this protection, you have to add code to your app that will check the "receipt" file that gets added by Mac OS X once the app has been validated (e.g. by asking the user to log in to his iTunes account, then verifying that the app has been properly acquired via this account).
- If add the "receipt" validation to your app, do the following:
- Install MBS Plugin to Filemaker
- Do a script step or calculation on application launch with performing this calculation:
- MBS( "Validate.Exit"; MBS( "Validate.CheckReceipt"; MBS( "Validate.FindReceipt" ); "1.0"; "de.monkeybreadsoftware.test" ) )
- Replace the two string values in the calculation with the version number and bundle ID in your info.plist.
- However, since the App Store will only be available in OS X 10.6.6 and later, you should also think about how you want your app to behave on earlier systems. Either quit your after after showing a message telling the user to update to 10.6.6 (which is not an option for those with a PowerPC based Mac, though!) or let the app continue to run, thereby allowing to run on any previous OS without needing a purchase. For example check that MBS("SystemInfo.OSVersionString") returns a value newer or equal to "Mac OS X 10.6.6".
- Build your app, then open the app package (bundle).
- Open the application icon file (usually appname.icns) inside Contents/Resources with "Icon Composer.app" (part of Xcode installation). Add the 512x512 icon to it and save. Or replace the file with a premade icon file.
- Open the "Info.plist" file inside the Contents folder with "Property List Editor.app" (part of Xcode installation).
- Edit the CFBundleVersion from a.b.c.d.e to a max-3-number value such as a.b or a.b.c
- Add a new child to the root with the Key name "LSApplicationCategoryType". Set its value to one of the ones listed here, under "Categorize Your Application": https://developer.apple.com/devcenter/mac/documents/submitting.html.
- Optionally, add a new child to the root with the key name "LSMinimumSystemVersion". Set its value to "10.6.6". This tells Mac OS that this app will only run on system with 10.6.6 or later installed. This is necessary because the license validation only works on 10.6.6 and later - if the app would be allowed to run on older systems, the app would have no way to ask the OS to validate a missing license (asking the user for his Store login and updating the license if the user has purchased the app properly). Of course, if you're providing a free app, then you can skip this step, along with leaving out the receipt validation.
- Open Terminal and "cd" to the folder in which the .app file resides. Issue the following commands:
- codesign -f -s "3rd Party Mac Developer Application: Your Name" "appname.app"
- productbuild --component "appname.app" /Applications --sign "3rd Party Mac Developer Installer: Your Name" appname.pkg
- Now the pkg file that's been created by the "productbuild" command can be uploaded using the "Application Loader.app" (might be included with Xcode 3.2.5 or available as an extra download from Apple's developer website).
Testing your receipt validation
If you have added the receipt validation code to your app then you can also test how this works. For this, if you're still using 10.6.5 or earlier, download and install the 10.6.6 update from Apple's developer site. Then create a test user for this app in iTunes Connect. Run your built app, which should then quit with code 173, by which OS X will then bring up a login dialog for iTunes connect, where you then log in as the previously created test user, which should then add the proper receipt file to your app's bundle and relaunch your app this time not quitting due to the valid receipt.
Any questions left? Feel free to contact Thomas Tempelmann (tempelmann@gmail.com) or Christian Schmitz (support@monkeybreadsoftware.de)